package reflect;

public class Test01 {
    public static void main(String[] args) throws ClassNotFoundException {
        // 通过反射获得类的class对象
        Class c1=Class.forName("reflect.User");
        Class c2=Class.forName("reflect.User");
        System.out.println(c1);
        System.out.println(c1.hashCode());
        System.out.println(c2.hashCode());
    }
}
// 实体类 pojo / entity
class User{
    private String name;
    int age;
    public User(String name, int age){
        this.name = name;
        this.age = age;
    }
    public User(){}

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }
}

